/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package systole.domain.signals;

import java.io.Serializable;

/**
 * 
 * @author jmj
 */
public class SelectedSegment implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = -8869374834058521651L;
    private int id;
    private int number;
    private Segment segment;

    /**
     *
     */
    public SelectedSegment() {
        super();
    }

    /**
     * @param number
     * @param segment
     */
    public SelectedSegment(int number, Segment segment) {
        super();
        this.number = number;
        this.segment = segment;
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the number
     */
    public int getNumber() {
        return number;
    }

    /**
     * @param number
     *            the number to set
     */
    public void setNumber(int number) {
        this.number = number;
    }

    /**
     * @return the segment
     */
    public Segment getSegment() {
        return segment;
    }

    /**
     * @param segment
     *            the segment to set
     */
    public void setSegment(Segment segment) {
        this.segment = segment;
    }

    /*
     * (non-Javadoc)
     *
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + number;
        result = prime * result + ((segment == null) ? 0 : segment.hashCode());
        return result;
    }

    /*
     * (non-Javadoc)
     *
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        SelectedSegment other = (SelectedSegment) obj;
        if (number != other.number) {
            return false;
        }
        if (segment == null) {
            if (other.segment != null) {
                return false;
            }
        } else if (!segment.equals(other.segment)) {
            return false;
        }
        return true;
    }

    /*
     * (non-Javadoc)
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "SelectedSegment [number=" + number + ", segment=" + segment
                + "]";
    }
}
